package org.example.demo.controller.userController;

import io.swagger.annotations.ApiOperation;
import org.example.demo.common.api.CommonResult;
import org.example.demo.dto.SuggestionParam;
import org.example.demo.service.userService.FavoriteService;
import org.example.demo.service.userService.FeedBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class FeedBackController {

    @Autowired
    private FeedBackService feedBackService;

    @ApiOperation("将反馈上传至数据库")
    @RequestMapping(value = "/user/feedback", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<String> UploadFeedBack(@RequestBody SuggestionParam suggestionParam) {
        return CommonResult.success(feedBackService.UploadFeedBack(suggestionParam));
    }
}
